<?php 
/* Connection vars here for example only. Consider a more secure method. */
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'rootpass';
$dbname = 'thingslook';
 
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
mysql_query("SET NAMES 'utf8'");
//mysql_query("SET NAMES GB2312");
mysql_select_db($dbname);

function db_query($qry_str) {return mysql_query($qry_str);}
function db_num($res) {return mysql_num_rows($res);}
function db_fetch_array($res) {return mysql_fetch_array($res);}
function db_fetch_object($res_num) {return mysql_data_seek($res,$num);}
function db_insert_id($res) {return mysql_insert_id($res);}
?>